{extend name="Common/common" /}

{block name="style"}

{/block}

{block name="content"}
<table class="layui-table">
    <colgroup>
        <col width="150">
        <col width="200">
        <col>
    </colgroup>
    <thead>
    <tr>
        <th>序号</th>
        <th>昵称</th>
        <th>留言</th>
        <th>创建时间</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    {volist name="comments" id="v"}
        <tr>
            <td style="width: 5%;">{$v['id']}</td>
            <td style="width: 10%;white-space: nowrap;overflow: hidden">{:mb_substr($v['nickname'], 0, 15, 'utf-8')}</td>
            <td style="width: 20%;white-space: nowrap;">{:mb_substr($v['comment'], 0, 15, 'utf-8')}...</td>
            <td style="width: 14%;">{:date('Y-m-d H:i:s', $v['created_at'])}</td>
            <td style="width: 15%;">
                {if $v['is_show'] == 0}
                    <form action="{:url('@admin/comment/'.$v['id'].'/show')}" method="post">
                        <input type="hidden" name="_method" value="PUT">
                        <input type="submit" value="前端显示" class="layui-btn layui-btn-normal">
                    </form>
                {else /}
                    <form action="{:url('@admin/comment/'.$v['id'].'/hiden')}" method="post">
                        <input type="hidden" name="_method" value="PUT">
                        <input type="submit" value="前端隐藏" class="layui-btn layui-btn-danger">
                    </form>
                {/if}
            </td>
        </tr>
    {/volist}
    </tbody>
</table>
{/block}

{block name="script"}

{/block}